package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.LeaveTeacherStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysMessageMapper;
import com.ruoyi.system.domain.SysMessage;
import com.ruoyi.system.service.ISysMessageService;

/**
 * 消息推送Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-11
 */
@Service
public class SysMessageServiceImpl implements ISysMessageService 
{
    @Autowired
    private SysMessageMapper sysMessageMapper;

    /**
     * 查询消息推送
     * 
     * @param messageId 消息推送主键
     * @return 消息推送
     */
    @Override
    public SysMessage selectSysMessageByMessageId(Long messageId)
    {
        return sysMessageMapper.selectSysMessageByMessageId(messageId);
    }

    /**
     * 查询消息推送列表
     * 
     * @param sysMessage 消息推送
     * @return 消息推送
     */
    @Override
    public List<SysMessage> selectSysMessageList(SysMessage sysMessage)
    {
        return sysMessageMapper.selectSysMessageList(sysMessage);
    }

    @Override
    public List<SysMessage> selectRecidSysMessageList(Long Recid) {
        return sysMessageMapper.selectSysMessageByRecId(Recid);
    }

    @Override
    public List<SysMessage> selectSendIdSysMessageList(Long sendId) {
        return sysMessageMapper.selectSysMessageBySendId(sendId);
    }

    @Override
    public List<LeaveTeacherStatus> selectMessage_info_idSysMessageList(Long message_info_id) {
        return sysMessageMapper.LeaveTeacherStatusList(message_info_id);
    }


    /**
     * 新增消息推送
     * 
     * @param sysMessage 消息推送
     * @return 结果
     */
    @Override
    public int insertSysMessage(SysMessage sysMessage)
    {
        sysMessage.setCreateTime(DateUtils.getNowDate());
        return sysMessageMapper.insertSysMessage(sysMessage);
    }
    /**
     * 新增请假消息推送
     *
     * @param sysMessage 消息推送
     * @return 结果
     */
    @Override
    public int insertSysLeaveMessage(SysMessage sysMessage) {
        return 0;
    }

    /**
     * 修改消息推送
     * 
     * @param sysMessage 消息推送
     * @return 结果
     */
    @Override
    public int updateSysMessage(SysMessage sysMessage)
    {
        return sysMessageMapper.updateSysMessage(sysMessage);
    }

    /**
     * 批量删除消息推送
     * 
     * @param messageIds 需要删除的消息推送主键
     * @return 结果
     */
    @Override
    public int deleteSysMessageByMessageIds(Long[] messageIds)
    {
        return sysMessageMapper.deleteSysMessageByMessageIds(messageIds);
    }

    /**
     * 删除消息推送信息
     * 
     * @param messageId 消息推送主键
     * @return 结果
     */
    @Override
    public int deleteSysMessageByMessageId(Long messageId)
    {
        return sysMessageMapper.deleteSysMessageByMessageId(messageId);
    }
}
